/**
 * PaperQuesDetail.java
 * Version 1.0.0
 * Created on 2018年7月17日
 *
 */
package com.yincheng.oes.business.exam.base.entity;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.yincheng.oes.business.base.entity.KnowledgeOutline;

/**
 * @author yangsy
 * @version 1.0.0
 * @since
 * 创建时间：2018年7月17日
 * 功能描述：试卷上题目列表信息类
 * 邮箱地址：446948434@qq.com
 */
public class PaperQuesDetail extends PaperDetail {

    /**
     * 题目编码
     */
    private String quesCode;

    /**
     * 题干
     */
    private String stem;

    /**
     * 题目
     */
    private String question;

    /**
     * 题目类型，1:A1型题，2:A2型题，3:B型题，4:X型题
     */
    private String quesType;

    /**
     * 题目类型值
     */
    private String quesTypeValue;

    /**
     * 关联题目关系值
     */
    private String relationCode;

    /**
     * 选项A
     */
    private String optionA;

    /**
     * 选项B
     */
    private String optionB;

    /**
     * 选项C
     */
    private String optionC;

    /**
     * 选项D
     */
    private String optionD;

    /**
     * 选项E
     */
    private String optionE;

    /**
     * 选项F
     */
    private String optionF;

    /**
     * 解析
     */
    private String analysis;

    /**
     * 答案
     */
    private String answer;

    private List<String> outlineTexts;// 关联的大纲全路径名称
    private List<KnowledgeOutline> outlines;// 关联的大纲

    private String quesNum;// 序号补零

    private String realQuestionYear;// 所属真题年代

    private String realQuestionNo;// 所属真题编号

    public List<String> getOutlineTexts() {
        return outlineTexts;
    }

    public void setOutlineTexts(List<String> outlineTexts) {
        this.outlineTexts = outlineTexts;
    }

    public List<KnowledgeOutline> getOutlines() {
        return outlines;
    }

    public void setOutlines(List<KnowledgeOutline> outlines) {
        this.outlines = outlines;
    }

    /**
     * @return the quesCode
     */
    public String getQuesCode() {
        return quesCode;
    }

    /**
     * @param quesCode the quesCode to set
     */
    public void setQuesCode(String quesCode) {
        this.quesCode = quesCode;
    }

    /**
     * @return the stem
     */
    public String getStem() {
        return stem;
    }

    /**
     * @param stem the stem to set
     */
    public void setStem(String stem) {
        this.stem = stem;
    }

    /**
     * @return the quesTypeValue
     */
    public String getQuesTypeValue() {
        return quesTypeValue;
    }

    /**
     * @param quesTypeValue the quesTypeValue to set
     */
    public void setQuesTypeValue(String quesTypeValue) {
        this.quesTypeValue = quesTypeValue;
    }

    /**
     * @return the quesType
     */
    public String getQuesType() {
        return quesType;
    }

    /**
     * @param quesType the quesType to set
     */
    public void setQuesType(String quesType) {
        this.quesType = quesType;
    }

    /**
     * @return the question
     */
    public String getQuestion() {
        return question;
    }

    /**
     * @param question the question to set
     */
    public void setQuestion(String question) {
        this.question = question;
    }

    /**
     * @return the relationCode
     */
    public String getRelationCode() {
        return relationCode;
    }

    /**
     * @param relationCode the relationCode to set
     */
    public void setRelationCode(String relationCode) {
        this.relationCode = relationCode;
    }

    public List<String> getOptions() {
        List<String> options = new ArrayList<String>();
        if (StringUtils.isNotEmpty(optionA)) {
            options.add(optionA);
        }
        if (StringUtils.isNotEmpty(optionB)) {
            options.add(optionB);
        }
        if (StringUtils.isNotEmpty(optionC)) {
            options.add(optionC);
        }
        if (StringUtils.isNotEmpty(optionD)) {
            options.add(optionD);
        }
        if (StringUtils.isNotEmpty(optionE)) {
            options.add(optionE);
        }
        if (StringUtils.isNotEmpty(optionF)) {
            options.add(optionF);
        }
        return options;
    }

    /**
     * @return the analysis
     */
    public String getAnalysis() {
        return analysis;
    }

    /**
     * @param analysis the analysis to set
     */
    public void setAnalysis(String analysis) {
        this.analysis = analysis;
    }

    /**
     * @return the answer
     */
    public String getAnswer() {
        return answer;
    }

    /**
     * @param answer the answer to set
     */
    public void setAnswer(String answer) {
        this.answer = answer;
    }

    public String getQuesNum() {
        return quesNum;
    }

    public void setQuesNum(String quesNum) {
        this.quesNum = quesNum;
    }

    public String getRealQuestionYear() {
        return realQuestionYear;
    }

    public void setRealQuestionYear(String realQuestionYear) {
        this.realQuestionYear = realQuestionYear;
    }

    public String getRealQuestionNo() {
        if (realQuestionYear == null) {
            return null;
        }
        DecimalFormat df = new DecimalFormat("000");
        return df.format(Integer.parseInt(realQuestionNo));
    }

    public void setRealQuestionNo(String realQuestionNo) {
        this.realQuestionNo = realQuestionNo;
    }
}
